<?php

namespace App\Providers;

use App\Models\Site;
use App\Policies\SitePolicy;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;

class AuthServiceProvider extends ServiceProvider
{

    protected $policies = [
        // 'App\Model' => 'App\Policies\ModelPolicy',
//        Site::class=>SitePolicy::class
    ];

    public function boot()
    {
        $this->registerPolicies();

        Gate::guessPolicyNamesUsing(function($modelClass){

            return str_replace(['Models','Entities'],'Policies',$modelClass).'Policy';

        });

    }
}
